package com.aistar.controller;

import com.aistar.service.OrderDetailsService;
import com.aistar.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/orderDetails")
public class OrderDetailsController {
    @Autowired
    private OrderDetailsService orderDetailsService;

    @GetMapping("/getAll/{orderId}")
    @ResponseBody
    public ServerResponse getAll(@PathVariable("orderId") Integer orderId){
        return orderDetailsService.getAllByOrderId(orderId);
    }

}
